package scauCmiScaffolding.compiled;

import org.eclipse.jet.JET2Context;
import org.eclipse.jet.JET2Template;
import org.eclipse.jet.JET2Writer;
import org.eclipse.jet.taglib.RuntimeTagElement;
import org.eclipse.jet.taglib.TagInfo;

public class _jet_cmiProjectProperties implements JET2Template {
    private static final String _jetns_c = "org.eclipse.jet.controlTags"; //$NON-NLS-1$
    private static final String _jetns_f = "org.eclipse.jet.formatTags"; //$NON-NLS-1$
    private static final String _jetns_java = "org.eclipse.jet.javaTags"; //$NON-NLS-1$

    public _jet_cmiProjectProperties() {
        super();
    }

    private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$
    
    private static final TagInfo _td_f_replaceAll_1_1 = new TagInfo("f:replaceAll", //$NON-NLS-1$
            1, 1,
            new String[] {
                "value", //$NON-NLS-1$
                "replacement", //$NON-NLS-1$
            },
            new String[] {
                "Dollar_symbol", //$NON-NLS-1$
                "$", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_7_9 = new TagInfo("c:get", //$NON-NLS-1$
            7, 9,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$packageName", //$NON-NLS-1$
            } );
    private static final TagInfo _td_java_format_17_1 = new TagInfo("java:format", //$NON-NLS-1$
            17, 1,
            new String[] {
            },
            new String[] {
            } );
    private static final TagInfo _td_c_get_19_38 = new TagInfo("c:get", //$NON-NLS-1$
            19, 38,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$projectName", //$NON-NLS-1$
            } );

    public void generate(final JET2Context context, final JET2Writer __out) {
        JET2Writer out = __out;
        RuntimeTagElement _jettag_f_replaceAll_1_1 = context.getTagFactory().createRuntimeTag(_jetns_f, "replaceAll", "f:replaceAll", _td_f_replaceAll_1_1); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_f_replaceAll_1_1.setRuntimeParent(null);
        _jettag_f_replaceAll_1_1.setTagInfo(_td_f_replaceAll_1_1);
        _jettag_f_replaceAll_1_1.doStart(context, out);
        JET2Writer _jettag_f_replaceAll_1_1_saved_out = out;
        while (_jettag_f_replaceAll_1_1.okToProcessBody()) {
            out = out.newNestedContentWriter();
            out.write(NL);         
            out.write("/***");  //$NON-NLS-1$        
            out.write(NL);         
            out.write(" * 这个类不能复制到其他项目中");  //$NON-NLS-1$        
            out.write(NL);         
            out.write(" * @author Liang Zaoqing");  //$NON-NLS-1$        
            out.write(NL);         
            out.write(" *");  //$NON-NLS-1$        
            out.write(NL);         
            out.write(" */");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("package ");  //$NON-NLS-1$        
            RuntimeTagElement _jettag_c_get_7_9 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_7_9); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_get_7_9.setRuntimeParent(_jettag_f_replaceAll_1_1);
            _jettag_c_get_7_9.setTagInfo(_td_c_get_7_9);
            _jettag_c_get_7_9.doStart(context, out);
            _jettag_c_get_7_9.doEnd();
            out.write(".base;");  //$NON-NLS-1$        
            out.write(NL);         
            out.write(NL);         
            out.write("import java.util.Set;");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("import org.springframework.beans.factory.annotation.Value;");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("import org.springframework.context.annotation.PropertySource;");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("import org.springframework.stereotype.Service;");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("/*");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("- CmiProperties封装所有基础属性，在Properties文件中配置");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("- */");  //$NON-NLS-1$        
            out.write(NL);         
            out.write(NL);         
            RuntimeTagElement _jettag_java_format_17_1 = context.getTagFactory().createRuntimeTag(_jetns_java, "format", "java:format", _td_java_format_17_1); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_java_format_17_1.setRuntimeParent(_jettag_f_replaceAll_1_1);
            _jettag_java_format_17_1.setTagInfo(_td_java_format_17_1);
            _jettag_java_format_17_1.doStart(context, out);
            JET2Writer _jettag_java_format_17_1_saved_out = out;
            while (_jettag_java_format_17_1.okToProcessBody()) {
                out = out.newNestedContentWriter();
                out.write(NL);         
                out.write("@Service");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("@PropertySource(value = { \"classpath:");  //$NON-NLS-1$        
                RuntimeTagElement _jettag_c_get_19_38 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_19_38); //$NON-NLS-1$ //$NON-NLS-2$
                _jettag_c_get_19_38.setRuntimeParent(_jettag_java_format_17_1);
                _jettag_c_get_19_38.setTagInfo(_td_c_get_19_38);
                _jettag_c_get_19_38.doStart(context, out);
                _jettag_c_get_19_38.doEnd();
                out.write("-project.properties\" })");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("public class CmiProjectProperties {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("//TODO　将project.properties文件中的配置注入到项目中，格式如下：");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("//\t@Value(\"Dollar_symbol{eventUploadDirectory}\")");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("//\tprotected String eventUploadDirectory;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                _jettag_java_format_17_1.handleBodyContent(out);
            }
            out = _jettag_java_format_17_1_saved_out;
            _jettag_java_format_17_1.doEnd();
            out.write(NL);         
            _jettag_f_replaceAll_1_1.handleBodyContent(out);
        }
        out = _jettag_f_replaceAll_1_1_saved_out;
        _jettag_f_replaceAll_1_1.doEnd();
    }
}
